package com.woniuxy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.entity.DishCategory;
import com.woniuxy.entity.Model;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ModelMapper extends BaseMapper<Model> {
    /**
    * @description: 根据模板名获取模板id
     * @param name:
     * @return: int
     * @date: 2021/8/18 16:06
     * @author: 魏炳豪
     */
    @Select("SELECT id FROM gfr_model WHERE NAME =#{name}")
        int getIdByName(String name);
/**
* @description:获取全部model
 * @return: java.util.List<com.woniuxy.entity.Model>
 * @date: 2021/8/19 11:35
 * @author: 魏炳豪
 */
    @Select("select * from gfr_model")
    @Results({
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "name", property = "name"),
    })
    List<Model> getAll();
}
